#include<assert.h>
#include<stdio.h>
#include<string.h>
int main(){
    char s[2000];
    fgets(s,80,stdin);//gets(s);
    int number,letter,space,other;
    int i,n=strlen(s);
    number=letter=space=other=0;
    for(i=0;i<n;i++){
        if('0'<=s[i]&&s[i]<='9')++number;
        else if('a'<=s[i]&&s[i]<='z' || 'A'<=s[i]&&s[i]<='Z')++letter;
        else if(s[i]==' '||s[i]=='\n' ||s[i]=='\t' ||s[i]=='\r')++space;
        else other++;
    }
    printf("%d %d %d %d\n",number,letter,space,other);

    return 0;
}
